<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>后台管理系统</title>
    <link rel="stylesheet" href="/static/layui/css/layui.css">
    <script src="/static/layui/layui.js"></script>
</head>
<body class="layui-layout-body">
    <div class="layui-layout layui-layout-admin">
        <div class="layui-header">
            <div class="layui-logo">后台管理系统</div>
            <ul class="layui-nav layui-layout-right">
                <li class="layui-nav-item">
                    <a href="javascript:;">管理员</a>
                    <dl class="layui-nav-child">
                        <dd><a href="">基本资料</a></dd>
                        <dd><a href="">安全设置</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item"><a href="">退出</a></li>
            </ul>
        </div>

        <div class="layui-side layui-bg-black">
            <div class="layui-side-scroll">
                <ul class="layui-nav layui-nav-tree"  lay-filter="leftMenu">
                    <!-- <li class="layui-nav-item layui-nav-itemed">
                        <a class="" href="javascript:;">所有用户</a>
                        <dl class="layui-nav-child">
                          <dd><a href="javascript:;" lay-href="view_users.html">查看用户</a></dd>
                          <dd><a href="javascript:;" lay-href="add_user.html">添加用户</a></dd>
                        </dl>
                    </li> -->
                    <li class="layui-nav-item layui-nav-itemed">
                      <a href="javascript:;">数据管理</a>
                      <dl class="layui-nav-child">
                        <dd><a href="javascript:;" lay-href="first_floor.html">一层数据</a></dd>
                        <dd><a href="javascript:;" lay-href="second_floor.html">二层数据</a></dd>
                        <dd><a href="javascript:;" lay-href="echart_info.html">数据分析</a></dd>
                      </dl>
                    </li> 
                </ul>
            </div>
        </div>

        <div class="layui-body">
          <!-- 内容主体区域 -->
          <iframe src="" id="mainContent" style="width:100%; height:100%; border:none;"></iframe>
        </div>
    </div>

    <script>
    layui.use(['element','jquery'], function(){
        var element = layui.element;
        var $ = layui.jquery;

        element.on('nav(leftMenu)', function(elem){
          // elem 是被点击的元素
          var url = elem.attr('lay-href'); // 假设每个导航项上有 lay-href 属性
          document.getElementById('mainContent').src = url; // 设置 iframe 的 src
        });
    });
    </script>
</body>
</html>
